<template>
	<view>
		<!-- 认购的产品组件 -->
		<view class="pt20 pb20">
			<UserProduct
				v-for="(item, index) in orderList"
				:key="item.order_id"
				:data="item"
				@handerDtrails="handerDtrails"
			></UserProduct>
		</view>
		<!-- 认购的产品组件 -->
	</view>
</template>

<script setup>
import { onMounted, ref } from 'vue';
import { getOrderList } from '@/utils/api.js';
import { onLoad } from '@dcloudio/uni-app';
let orderList = ref([]);
const getOrder = () => {
	getOrderList().then(res => {
		orderList.value = res.data;
		console.log(res.data);
	});
};
onMounted(() => {
	let pageHead = document.getElementsByTagName('uni-page-head');
	pageHead[0].style.display = 'none';
});
let handerDtrails=(id)=>{
    uni.navigateTo({
    	url:'/pages/myorderdetails/myorderdetails?id='+id
    })
}
onLoad(() => {
	getOrder();
});
</script>

<style lang="scss"></style>
